package com.jeesite.modules.purchaseinbound.entity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import java.math.BigDecimal;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 采购入库单条码Entity
 * @author 码脑洞
 * @version 2025-04-13
 */
@Table(name="t_purchase_inbound_barcode", alias="a", label="采购入库单条码信息", columns={
		@Column(name="auto_id", attrName="autoId", label="主键", isPK=true),
		@Column(name="header_auto_id", attrName="headerAutoId", label="采购入库单主键ID"),
		@Column(name="line_auto_id", attrName="lineAutoId", label="采购入库单行主键ID"),
		@Column(name="barcode", attrName="barcode", label="条码号"),
		@Column(name="batch", attrName="batch", label="批次号"),
		@Column(name="inv_id", attrName="invId", label="存货ID", isUpdateForce=true),
		@Column(name="warehouse_id", attrName="warehouseId", label="仓库ID", isUpdateForce=true),
		@Column(name="area_id", attrName="areaId", label="仓区ID", isUpdateForce=true),
		@Column(name="shelves_id", attrName="shelvesId", label="货架ID", isUpdateForce=true),
		@Column(name="position_id", attrName="positionId", label="库位ID", isUpdateForce=true),
		@Column(name="qty", attrName="qty", label="条码数量", isUpdateForce=true),
		@Column(name="status", attrName="status", label="状态", comment="状态（0正常 1删除 2停用 3冻结 4审核 5驳回 9草稿）;状态（0正常 1删除 2停用 3冻结 4审核 5驳回 9草稿）", isUpdate=false),
	}, orderBy="a.auto_id DESC"
)
public class PurchaseInboundBarcode extends DataEntity<PurchaseInboundBarcode> {
	
	private static final long serialVersionUID = 1L;
	private Long autoId;		// 主键
	private Long headerAutoId;		// 采购入库单主键ID
	private Long lineAutoId;		// 采购入库单行主键ID
	private String barcode;		// 条码号
	private String batch;		// 批次号
	private Long invId;		// 存货ID
	private Long warehouseId;		// 仓库ID
	private Long areaId;		// 仓区ID
	private Long shelvesId;		// 货架ID
	private Long positionId;		// 库位ID
	private BigDecimal qty;		// 条码数量

	public PurchaseInboundBarcode() {
		this(null);
	}
	
	public PurchaseInboundBarcode(String id){
		super(id);
	}
	
	@JsonSerialize(using = ToStringSerializer.class)
	public Long getAutoId() {
		return autoId;
	}

	public void setAutoId(Long autoId) {
		this.autoId = autoId;
	}
	
	@NotNull(message="采购入库单主键ID不能为空")
	public Long getHeaderAutoId() {
		return headerAutoId;
	}

	public void setHeaderAutoId(Long headerAutoId) {
		this.headerAutoId = headerAutoId;
	}
	
	@NotNull(message="采购入库单行主键ID不能为空")
	public Long getLineAutoId() {
		return lineAutoId;
	}

	public void setLineAutoId(Long lineAutoId) {
		this.lineAutoId = lineAutoId;
	}
	
	@NotBlank(message="条码号不能为空")
	@Size(min=0, max=100, message="条码号长度不能超过 100 个字符")
	public String getBarcode() {
		return barcode;
	}

	public void setBarcode(String barcode) {
		this.barcode = barcode;
	}
	
	@Size(min=0, max=100, message="批次号长度不能超过 100 个字符")
	public String getBatch() {
		return batch;
	}

	public void setBatch(String batch) {
		this.batch = batch;
	}
	
	public Long getInvId() {
		return invId;
	}

	public void setInvId(Long invId) {
		this.invId = invId;
	}
	
	public Long getWarehouseId() {
		return warehouseId;
	}

	public void setWarehouseId(Long warehouseId) {
		this.warehouseId = warehouseId;
	}
	
	public Long getAreaId() {
		return areaId;
	}

	public void setAreaId(Long areaId) {
		this.areaId = areaId;
	}
	
	public Long getShelvesId() {
		return shelvesId;
	}

	public void setShelvesId(Long shelvesId) {
		this.shelvesId = shelvesId;
	}
	
	public Long getPositionId() {
		return positionId;
	}

	public void setPositionId(Long positionId) {
		this.positionId = positionId;
	}
	
	public BigDecimal getQty() {
		return qty;
	}

	public void setQty(BigDecimal qty) {
		this.qty = qty;
	}
	
}